<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://module.nado.com/pagination/taglibs" prefix="pagination" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
$(document).ready(function(){
	// setting date
	$(".date-pick").datePicker({autoFocusNextInput: true});
	$(".date-pick").mask("9999-99-99");
});

function doDetail(noticeNo) 
{
	$("#" + noticeNo).toggle();
}
</script>
</head>

<body>
<form action="/service/notice" method="get">
<div class="content_top">
	<p class="path">
		<strong>공지사항</strong>
	</p>
</div>

<fieldset class="search_type1">
	<legend>검색</legend>
	<table cellspacing="0" border="0" class="section">
	<tr>
	<td class="forms">
		<table cellspacing="0" border="1">
		<tr>
		<th>등록일시</th>
		<td>
			<span class="input_date"><input name="sdt" id="sdt" style="width:70px" class="date-pick" /></span>
			~
			<span class="input_date"><input name="edt" id="edt" style="width:70px" class="date-pick" /></span>
		</td>
		<th>공지분류</th>
		<td>
			<select id="tcd" name="tcd" style="width: 80px;">
				<option value="ALL">All</option>
				<c:forEach items="${typeCdList}" var="item">
				<option value="${item.commonCode}">${item.commonName}</option>
				</c:forEach>
			</select>
		</td>
		</table>
	</td>
	
	<td class="btn">
		<a href="#" class="btn_big" onclick="document.forms[0].submit();" ><strong>검색</strong></a>
	</td>
	</tr>
	</table>
</fieldset>
<br>
</form>

<div class="div_left">
Total : <b id="total">${noticeCount}</b> 건
</div>

<div class="div_right">
	<a href="/service/notice/form" class="btn_sml"><span>새로등록</span></a>
	<a href="javascript:;" class="btn_sml"><span>선택삭제</span></a>
</div>
<br>
<br>

<div class="tbl_type1">
	<table cellspacing="0" border="1">
		<col width="40">
		<col width="60">
		<col width="85">
		<col>
		<col width="85">
		<col width="85">
		<col width="40">
		
		<thead>
		<tr>
			<th><input type="checkbox" class="chkAll"></th>
			<th>No.</th>
			<th>분류</th>
			<th>제목</th>
			<th>노출여부</th>
			<th>등록일시</th>
			<th><img src="/share/img/edit.gif"></th>
		</tr>
		</thead>
		
		<tbody>
		<c:forEach items="${noticeList}" var="item">
		<tr>
			<td align="center"><input type="checkbox" class="chkAll"></td>
			<td align="center">${item.noticeNo}</td>
			<td align="center">${item.typeCd}</td>
			<td><a href="#" onclick="doDetail(${item.noticeNo});">${item.title}</a></td>
			<td align="center">${item.useYn}</td>
			<td align="center">${item.registDate}</td>
			<td align="center"><a href="/service/notice/form?no=${item.noticeNo}"><img src="/share/img/edit.gif"></a></td>
		</tr>
		<tr id="${item.noticeNo}" style="display: none;">
			<td colspan="7">
				<div class="tbl_type3">
					<table cellspacing="0" border="1">
						<col width="120">
						<col>
						
						<tr>
							<th>배너내용</th>
							<td>${item.contents}</td>
						</tr>
					</table>
				</div>
			</td>
		</tr>
		</c:forEach>
		<c:if test="${empty noticeList}">
		<tr>
			<td colspan="7" align="center">검색한 데이터가 없습니다.</td>
		</tr>
		</c:if>
		</tbody>
	</table>
</div>

<div id="paginate" class="paginate">
	<pagination:paginate paginationInfo="${paginate}"/>
</div>
</body>
</html>